﻿using UnityEngine;
using Com.ZX;
using Com.ZX.Manager;
using FairyGUI;

public class StartUI : MonoBehaviour {

    // Use this for initialization
    void InitMgr()
    {
        ResrManager.inst.onInit();
        UIManager.inst.onInit();
        ViewModelManager.inst.onInit();
        //MsgManager.inst.onInit();
        CustomDebug.init();
    }
    Window testOne;
    void Awake()
	{
        Application.targetFrameRate = 60;
        InitMgr();
        //UIPackage.AddPackage("UI/TestOne");
        //var obj= UIPackage.CreateObject("TestOne", "Main") as GComponent;
        //obj.
        //UIPackage.AddPackage("UI/RenderTexture");
        //testOne = new TestOne();
        //testOne.fairyBatching = false;
        //obj = new TestObj();
    }
	void Start ()
	{
        //obj = null;
        //GameObject go = Instantiate(Resources.Load<GameObject>("Prefabs/TestOne"));
        //TestOne tOne = go.GetComponent<TestOne>();
        //if (tOne == null)
        //	tOne = go.AddComponent<TestOne>(); 

        UIManager.inst.OpenUI(EnumUIType.TestOne, 0);

        //testOne.Show();


        //GameObject go = null;
        //float time = System.Environment.TickCount;
        ////int a = 0;
        //for (int i = 0; i < 100; i++)
        //{
        //	go = null;
        //	ResrManager.inst.LoadInstanceCoroutine("Prefabs/Cube",(obj)=> 
        //	{
        //		go = ((GameObject)obj);
        //		go.transform.position = Random.insideUnitSphere * 10;
        //		//a++;
        //	});
        //}
        //CustomDebug.Log("time:" + (System.Environment.TickCount - time));
    }
    void Update()
    {
        //if (Time.deltaTime%3 == 0)
        //{
        //    CustomDebug.Log("3");
        //}
    }
}
